<!doctype html><html><head><title>rb.publish.PublishCommand</title><link href="../../stylesheet.css" rel="stylesheet" type="text/css"></head><body><a href="../../index.html">Home</a><h1>Class rb.publish.PublishCommand</h1><p>A command object for posting new blog entries.</p>extends <a href="../../relief/rpc/Command.html">relief.rpc.Command</a><table class="method-list"><tr><td colspan="2"><strong>Instance Method Summary</strong></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>getCacheKeys() &#8658; ?Array</code><br><p class="method-description">When command.readFromCache is true, the RPC service calls this method to
get the cache key(s) for which to query the cache.  If no
value was stored for the given keys, the server request is executed.

Subclasses that set readFromCache to true must define a getCacheKeys method.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>getCacheValues() &#8658; ?Array</code><br><p class="method-description">When a response comes back from the server for a cacheable request, the
RPC service will call onSuccess so that the command object can perform
whatever processing it needs (including execution of the client's callback).
Once onSuccess returns, the RPC service calls this method to obtain the
cache keys and values that should be stored.

This method will only ever be called after the command's onSuccess method
was called.

If, on a future request, the RPC service finds a value for the cache keys,
the values returned by this method will be what is passed to the command
object's onCacheHit method.

This method must return an array of record objects with a "key" attribute
(this should be the same string as returned by getCacheKeys); and a "value"
attribute, which is the value to be stored in the cache.

The RPC service always stores items in the cache by value, meaning that
the value attribute of this method's returned object must either implement
relief.cache.Cloneable (ie., it has a clone() method) or it must be cast
to a relief.cache.SimpleValue.  See documentation for rpc.cache.Cache
for details on using these interfaces.

Subclasses that set writeToCache to true must define a getCacheValues method.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>getData() &#8658; (string|undefined)</code><br><p class="method-description">This method is called by the RPCService when formulating the call to the
server.  getData serializes the data for use as an XHR POST payload.  If no
data is to be sent to the server, the method must return undefined.

All subclasses that should have POST content must define a getData method.</p></td></tr><tr><td class="method-list-cell method-access method-private"></td><td class="method-list-cell method-cell"><code>hashPost_(?rb.post.BlogPost post) &#8658; string</code><br><p class="method-description">Create a Sha1 checksum of the post contents.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>onFailure(?goog.net.XhrManager.Event event)</code><br><p class="method-description">Callback for failed server responses.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>onSuccess(?goog.net.XhrManager.Event event)</code><br><p class="method-description">Callback for successful server requests.</p></td></tr></table></body></html>